package org.dk.service.Impl;

import com.alibaba.dubbo.config.annotation.Service;
import org.dk.mapper.TbContentCategoryMapper;
import org.dk.pojo.TbContentCategory;
import org.dk.service.ConCateService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
@org.springframework.stereotype.Service
public class ConCateServiceImpl implements ConCateService {

    @Autowired
    private TbContentCategoryMapper categoryMapper;

    @Override
    public List<TbContentCategory> selectConCate(String name) {
        return categoryMapper.selectConCate(name);
    }

    @Override
    public void addConCat(TbContentCategory category) {
        categoryMapper.insertSelective(category);
    }

    @Override
    public void deleteConCat(Long[] ids) {
        categoryMapper.deleteByPrimaryKeys(ids);
    }

    @Override
    public TbContentCategory updateConCatReturn(Long id) {
        return categoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public void updateConCat(TbContentCategory category) {
        categoryMapper.updateByPrimaryKeySelective(category);
    }
}
